﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SystemCenterSoa.DtoModel.SystemManager
{
    public class ModuleDto
    {
        /// <summary>
        /// 模块code
        /// </summary>
        [StringLength(50)]

        public string module_code
        {
            get; set;
        }
        [StringLength(100)]
        [Required]
        /// <summary>
        /// 模块名称
        /// </summary>
        public string module_name
        {
            get; set;
        }
        [StringLength(100)]
        [Required]
        /// <summary>
        /// 父模块code
        /// </summary>
        public string parent_code
        {
            get; set;
        }
        /// <summary>
        /// 模块级别
        /// </summary>
        [Required]
        public int module_level
        {
            get; set;
        }
        /// <summary>
        /// 是否是菜单  1:菜单   2:不是菜单
        /// </summary>
        [Required]
        public int is_menu
        {
            get; set;
        }
        /// <summary>
        /// 是否是菜单  1:请求   2:不是请求
        /// </summary>
        [Required]
        public int is_action
        {
            get; set;
        }
        /// <summary>
        /// 请求url
        /// </summary>
        public string action_url
        {
            get; set;
        }
        /// <summary>
        /// 排序字段
        /// </summary>
        [Required]
        public decimal order_by
        {
            get; set;
        }
        /// <summary>
        /// 模块状态  1:有效  2:无效
        /// </summary>
        [Required]
        public int module_status
        {
            get; set;
        }
        public string creator_name
        {
            get; set;
        }

        /// <summary>
        /// 创建日期
        /// </summary>
        public DateTime creator_date
        {
            get; set;
        }
        /// <summary>
        /// 子列表
        /// </summary>
        public List<ModuleDto> SonModules { get; set; }

        public string label
        {
            get
            {
                return module_name;

            }
        }

        public string parent_name { get; set; }

        /// <summary>
        /// 封装一个属性,把SonModules  封装为 children  为了可以让element ui的树直接调用
        /// </summary>
        public List<ModuleDto> children
        {
            get
            {
                return SonModules;
            }
        }
    }
}
